#pragma once
#include "instrument.h"
#include "AR.h"
#include "Organ.h"
#include "OrganEnvelope.h"
#include <vector>
#include "Notes.h"

using namespace std;

class COrganInstrument :
    public CInstrument
{
public:
    COrganInstrument(void);
    ~COrganInstrument(void);

    virtual void Start();
    virtual bool Generate();
    virtual void SetNote(CNote *note);
    
    void SetDuration(double d) {m_organenvelope.SetDuration(d);m_organ.SetDuration(d);}
    void SetFreq(double f) {m_organ.SetFreq(f);}
	void SetAmplitude(double a) {m_organ.SetAmplitude(a);}
	void SetDrawbars(vector<double> drawbars) {m_organ.SetDrawbars(drawbars);}
	
	void COrganInstrument::SetDrawbars(int drawbarNum);

	void SetVibratoFreq(double VibratoF) {m_organ.SetVibratoFreq(VibratoF);}
	void SetVibratoMag(double VibratoM) {m_organ.SetVibratoMag(VibratoM);}	

	void SetLeslieFreq(double LeslieF) {m_organ.SetLeslieFreq(LeslieF);}
	void SetLeslieEndFreq(double LeslieEF) {m_organ.SetLeslieEndFreq(LeslieEF);}
	void SetLeslieStartFreq(double LeslieSF) {m_organ.SetLeslieStartFreq(LeslieSF);}
	void SetLeslieRadius(double LeslieR) {m_organ.SetLeslieRadius(LeslieR);}	
	void SetLeslieAttackTime(double LeslieAT);
	void SetLeslieReleaseTime(double LeslieRT) {m_organ.SetLeslieReleaseTime(LeslieRT);}
	void SetLeslieChanged(bool LeslieC) {m_organ.SetLeslieChanged(LeslieC);}

private:
    CAR         m_ar;
	COrgan	m_organ;
	COrganEnvelope m_organenvelope;
	double m_duration;
	double m_time;
	vector<double> m_drawbars;
	bool m_changeleslie;
};